package cn.lingyangwl.agile.infra.misc.controller;

import cn.lingyangwl.agile.infra.misc.service.*;
import cn.lingyangwl.agile.infra.module.misc.*;
import cn.lingyangwl.framework.core.response.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 公共的
 *
 * @author shenguangyang
 */
@Slf4j
@RestController
@RequestMapping("/common")
public class InfraCommonController {
    @Resource
    private InfraCommonService infraCommonService;

    @GetMapping("/ip2Region")
    public Resp<Ip2RegionDto> ip2Region(@RequestParam("ip") String ip) {
        return Resp.ok(infraCommonService.ip2Region(ip));
    }
}
